// $Id: string_encoding.hpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#ifndef XPCOM_STRING_ENCODING_HPP
#define XPCOM_STRING_ENCODING_HPP

#include <xpcom/config.hpp>
#include <xpcom/string.hpp>

#ifdef BOOST_HAS_ABI_HEADERS
#include BOOST_ABI_PREFIX
#endif

namespace xpcom {
namespace string_encoding {

XPCOM_DECL void ascii_to_utf16(const string& src, wstring& dest);
inline wstring ascii_to_utf16(const string& src)
{
    wstring ret;
    ascii_to_utf16(src, ret);
    return ret;
}

XPCOM_DECL void native_to_utf16(const string& src, wstring& dest);
inline wstring native_to_utf16(const string& src)
{
    wstring ret;
    native_to_utf16(src, ret);
    return ret;
}

XPCOM_DECL void utf8_to_utf16(const string& src, wstring& dest);
inline wstring utf8_to_utf16(const string& src)
{
    wstring ret;
    utf8_to_utf16(src, ret);
    return ret;
}

XPCOM_DECL void utf16_to_ascii(const wstring& src, string& dest);
inline string utf16_to_ascii(const wstring& src)
{
    string ret;
    utf16_to_ascii(src, ret);
    return ret;
}

XPCOM_DECL void utf16_to_native(const wstring& src, string& dest);
inline string utf16_to_native(const wstring& src)
{
    string ret;
    utf16_to_native(src, ret);
    return ret;
}

XPCOM_DECL void utf16_to_utf8(const wstring& src, string& dest);
inline string utf16_to_utf8(const wstring& src)
{
    string ret;
    utf16_to_utf8(src, ret);
    return ret;
}

} // namespace xpcom::string_encoding
} // namespace xpcom

#ifdef BOOST_HAS_ABI_HEADERS
#include BOOST_ABI_SUFFIX
#endif

#endif // XPCOM_STRING_ENCODING_HPP
